<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>

<html>
<head>
<title>借款报销统计查询</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/extjs.jsp" %>
<%@include file="/common/meta.jsp"%>
<script type="text/javascript">
</script>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header">借款报销统计查询</div>
<div class="x-toolbar">
  <table width="99%">
        <tr>
        <s:form action="index" theme="simple" id="form1">
	      <td width="60">统计类型：</td>
	      <td width="90"><s:select list='countTypeMap' name="countType" cssStyle="width:80px" headerKey="" headerValue="请选择"></s:select></td>        
          <td width="60">开始日期：</td>
          <td width="100"><input id="startDate" name="startDate" size="12" value="<s:date name='startDate' format='yyyy-MM-dd'/>" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/>&nbsp;&nbsp;</td>
          <td width="60">结束日期：</td>
          <td width="100"><input id="endDate" name="endDate" size="12" value=" <s:date name='endDate' format='yyyy-MM-dd'/>" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/></td>
          <td><s:submit value="查询" cssClass="button" cssStyle="width:45px;"></s:submit></td>          
        </s:form>
        </tr>
      </table>
</div>
<div class="x-panel-body">
<ec:table items="items" var="item" retrieveRowsCallback="process" sortRowsCallback="process" 
	    action="index.do"
		useAjax="true" doPreload="false"
		maxRowsExported="10000000" 
		pageSizeList="15,50,100" 
		editable="false" 
		sortable="false"	
		rowsDisplayed="15"	
		generateScript="true"	
		resizeColWidth="true"	
		classic="false"	
		width="100%" 	
		height="400px"	
		minHeight="400"
		toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row> 
	    <ec:column width="30" property="_s" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/>
	    <s:if test="countType == null || countType == 1">
	      <ec:column width="160" property="user.name" title="人员名称"/>
	    </s:if>
	    <s:elseif test="countType == null || countType == 2">
	   	  <ec:column width="160" property="dept.name" title="部门名称"/>
	   	</s:elseif>
	   	<s:elseif test="countType == 3">
	   	  <ec:column width="160" property="project.name" title="项目名称"/>
	   	</s:elseif>
	    <ec:column width="100" property="borrowAmount" title="借款金额" style="text-align:right" format="#,##0.00" cell="number"/>
        <ec:column width="100" property="reimbAmount" title="报销金额" style="text-align:right" format="#,##0.00" cell="number"/>
	</ec:row>
	<s:if test="#attr.items.size()!=0">
		<ec:extendrow>
			<tr style="background-color: #ffe3ee">
				<td colspan="2" align="right" id="No1"
					style="font-weight: bold; border-top: 0px; border-bottom: 0px; border-left: 0px;">合计：</td>
				<td align="right">&nbsp;<fmt:formatNumber value="${totalBorrowAmount}" pattern="#,##0.00"/></td>
				<td align="right">&nbsp;<fmt:formatNumber value="${totalReimbAmount}" pattern="#,##0.00"/></td>
			</tr>
		</ec:extendrow>
	</s:if>	
</ec:table>
</div>
</div>
</body>
</html>